// pages/index/index.js
Page({
  data: {
    attractions: [
      {
        id: 1,
        name: '龙象塔',
        description: '青秀山标志性建筑，登塔可俯瞰南宁全景',
        image: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.MYcoQDRkVWJNe9xZHzJ-RQAAAA?w=223&h=180&c=7&r=0&o=7&dpr=1.5&pid=1.7&rm=3',
        tags: ['标志建筑', '观景台']
      },
      {
        id: 2,
        name: '天池',
        description: '碧波荡漾的人工湖，可乘船游览',
        image: 'https://tse1-mm.cn.bing.net/th/id/OIP-C.3BsX_ffNMdAwDOCj24lR7AHaEd?w=314&h=187&c=7&r=0&o=7&dpr=1.5&pid=1.7&rm=3',
        tags: ['湖泊', '游船']
      },
      {
        id: 3,
        name: '苏铁园',
        description: '国内最大的苏铁专类园',
        image: 'https://tse1-mm.cn.bing.net/th/id/OIP-C.rQn-TLTTwGSmieJeegBudAHaEw?w=233&h=180&c=7&r=0&o=7&dpr=1.5&pid=1.7&rm=3',
        tags: ['植物园', '科普']
      },
      {
        id: 4,
        name: '观音禅寺',
        description: '历史悠久的佛教寺庙',
        image: 'https://tse3-mm.cn.bing.net/th/id/OIP-C.Y07-ZTnGpd17ACC_SP1hJQHaFJ?w=220&h=180&c=7&r=0&o=7&dpr=1.5&pid=1.7&rm=3',
        tags: ['寺庙', '文化']
      },
      {
        id: 5,
        name: '友谊长廊',
        description: '连接各景点的美丽长廊',
        image: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.mrWw44J5-Z0Ztx1x2MK9KQHaE8?w=257&h=180&c=7&r=0&o=7&dpr=1.5&pid=1.7&rm=3',
        tags: ['长廊', '休闲']
      },
      {
        id: 6,
        name: '棕榈园',
        description: '热带风情植物园区',
        image: 'https://tse1-mm.cn.bing.net/th/id/OIP-C.RT3K81ZtraSdAg6K387PNwHaEo?w=311&h=194&c=7&r=0&o=7&dpr=1.5&pid=1.7&rm=3',
        tags: ['植物', '热带']
      },
      {
        id: 7,
        name: '荷花池',
        description: '夏季赏荷的绝佳地点',
        image: 'https://tse1-mm.cn.bing.net/th/id/OIP-C.yvixusiNaXBiCrLbnmjS2AHaEq?w=293&h=185&c=7&r=0&o=7&dpr=1.5&pid=1.7&rm=3',
        tags: ['花卉', '摄影']
      },
      {
        id: 8,
        name: '儿童乐园',
        description: '亲子游玩的好去处',
        image: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.twuKL_TlWdsGYnf_sg5O-wHaEn?w=249&h=180&c=7&r=0&o=7&dpr=1.5&pid=1.7&rm=3',
        tags: ['亲子', '娱乐']
      }
    ],
    routes: [
      {
        id: 1,
        index: '1',
        name: '经典半日游',
        duration: '3-4小时',
        distance: '3公里',
        content: '北门 → 龙象塔 → 天池 → 苏铁园 → 观音禅寺 → 友谊长廊',
        tips: '适合时间紧张的游客'
      },
      {
        id: 2,
        index: '2',
        name: '休闲一日游',
        duration: '6-7小时',
        distance: '5公里',
        content: '西门 → 友谊长廊 → 观音禅寺 → 天池（午餐）→ 苏铁园 → 龙象塔',
        tips: '推荐在天池周边用餐'
      },
      {
        id: 3,
        index: '3',
        name: '亲子游路线',
        duration: '4-5小时',
        distance: '2.5公里',
        content: '北门 → 儿童乐园 → 友谊长廊 → 天池（游船）→ 苏铁园',
        tips: '包含儿童娱乐项目'
      }
    ]
  },

  onLoad: function (options) {
    console.log('青秀山一日游页面加载');
  },

  onReady: function () {
    console.log('青秀山一日游页面渲染完成');
  },

  // 导航到地图页面
  navigateToMap: function() {
    wx.showToast({
      title: '跳转景区地图',
      icon: 'none'
    });
  },

  // 导航到交通指南页面
  navigateToTransport: function() {
    wx.showToast({
      title: '跳转交通指南',
      icon: 'none'
    });
  },

  // 导航到失物招领
  navigateToLostFound: function() {
    wx.showToast({
      title: '跳转失物招领',
      icon: 'none'
    });
    wx.navigateTo({
      url: '/pages/LostFound/LostFound'
    });
  },

    // 导航到门票预订页面
    navigateToTickets: function() {
      wx.showToast({
        title: '跳转门票预订',
        icon: 'none'
      });
    },

  

  // 导航到美食页面
  navigateToFood: function() {
    wx.showToast({
      title: '跳转特色美食',
      icon: 'none'
    });
  },
  //
  navigateToTreasure: function() {
    wx.showToast({
      title: '跳转寻宝',
      icon: 'none'
    });

    
  },

  // 查看景点详情
  viewAttractionDetail: function(e) {
    const id = e.currentTarget.dataset.id;
    const attraction = this.data.attractions.find(item => item.id === id);
    wx.showToast({
      title: `查看${attraction.name}`,
      icon: 'none'
    });
  },

  // 查看所有景点
  viewAllAttractions: function() {
    wx.showToast({
      title: '查看所有景点',
      icon: 'none'
    });
  },

  // 查看路线详情
  viewRouteDetail: function(e) {
    const id = e.currentTarget.dataset.id;
    const route = this.data.routes.find(item => item.id === id);
    wx.showToast({
      title: `查看${route.name}`,
      icon: 'none'
    });
  },

  // 查看所有路线
  viewAllRoutes: function() {
    wx.showToast({
      title: '查看所有路线',
      icon: 'none'
    });
  }
})